<%--
  Created by IntelliJ IDEA.
  User: 21719
  Date: 2024/5/18
  Time: 17:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录界面</title>
    <style>
        #outerLoginFrame {
            width: 500px;
            height: 400px;
            margin-left: 500px;
            margin-top: 240px;
        }
        #innerLoginFrame {
            width: 360px;
            margin-left: 75px;
            margin-top: 90px;
            color: gray;
            font-size: 25px;
        }
        input {
            width: 220px;
            height: 30px;
        }
    </style>
</head>
<body>
<div id="outerLoginFrame" style="border: palevioletred 2px solid">
    <h1 align="center" style="margin-top: 40px;color: lightskyblue">员工管理系统</h1>
    <div id="innerLoginFrame">
        <form action="userLogin" method="post" >
            账户:<input type="text" style="font-size: 28px;" id="userAccount" name="userAccount" class="myText"><br><br>
            密码:<input type="password" style="font-size: 28px;" id="userPassword" name="userPassword" class="myText"><br>
            <input style="width: 140px; margin-left:20px;" onclick="return checkLogin()" type="submit" value="登录">
            <a href="register.jsp" style="width: 140px; margin-left:20px;" type="submit" > | &nbsp;注册</a><br>
            <span style="color: red; font-size:15px" id="tip">${tip}</span>
        </form>
    </div>
</div>


</body>
</html>

<script>
    function checkLogin() {
        let userAccount = document.getElementById("userAccount").value;
        let userPassword = document.getElementById("userPassword").value;
        if(userAccount==null||userAccount.trim() == ""){
            document.getElementById("tip").innerHTML = "账户不能为空";
            return false;
        }
        if(userPassword==null||userPassword.trim() == ""){
            document.getElementById("tip").innerHTML = "密码不能为空";
            return false;
        }
        return true;
    }
</script>